package weixin.core.controller;

import com.github.sd4324530.fastweixin.api.MessageAPI;
import com.github.sd4324530.fastweixin.api.response.GetSendMessageResponse;
import com.github.sd4324530.fastweixin.message.MusicMsg;
import com.github.sd4324530.fastweixin.message.TextMsg;
import com.github.sd4324530.fastweixin.message.VoiceMsg;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by lxb on 2015/12/30.
 */
@Controller
@RequestMapping("/sendMessage")
public class SendMessageController {
    private static final Logger LOG  = LoggerFactory.getLogger(SendMessageController.class);
    @Autowired
    private MessageAPI MessageAPI;
    @RequestMapping("sendMessageToUser")
    @ResponseBody
    public String sendMessageToUser(){
        VoiceMsg voiceMsg=new VoiceMsg("90SLott3azc0tyaW2b-y-gUsYn5yaPYhVO0r4-gbRvQ");
        MessageAPI.sendMessageToUser(voiceMsg, true, null, null);
        return "success";
    }
}
